<?php
/**
 * Created by PhpStorm.
 * Admininfo: Administrator
 * Date: 2017/12/13
 * Time: 13:58
 */

namespace app\common\validate;
use think\Validate;
class Admininfo extends  Validate{
  protected $rule=[
  	'name'=>['require','unique:admininfo','max:10','min:2'],
  	//'phone'=>['require','unique:admininfo','/^1[345678]\d{9}$/']
  ];
	//验证不符返回msg
	protected $message  =   [
		'name.require'   => '名称必须填写！',
		'name.min'   => '名称最短二位!',
		'name.max'   => '名称最长十位!',
		'name.unique'   => '名称已存在！',
//		'phone.unique'   => '手机号已存在！',
//		'phone.require'   => '手机号必须填写！',
//		'phone'   => '手机号格式错误,请输入正确的手机号！',
	];
    protected $scene = [
        'edit' => ['name.unique'=>'require|unique:user,name^id'],
    ];
}